home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / test / testint.sml < prev    next >
Encoding:
Text File  |  1996-07-03  |  344 b   |  17 lines  |  [TEXT/R*ch]

  1.  
  2. fun show s = (output(std_out, s); flush_out std_out);
  3. fun showint (i:int) = show (makestring i);
  4. fun showintnl i = (showint i; show "\n");
  5.  
  6.  
  7. fun f n =
  8.   let
  9.     fun loop () = (showint n; loop ())
  10.   in
  11.     case n
  12.       of 0 => 0
  13.        | _ => (loop() handle Interrupt => f (n-1))
  14.   end;
  15.  
  16. output(std_out, "Enter `f 5;', and then press ^C !\n");
  17.